package com.beerandjesus.sportofkings.handicapper.factory.brisnet.singlefile;

import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.Pedigree;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.PedigreeImpl;
import org.springframework.stereotype.Component;

@Component
public class PedigreeFactoryImpl extends AbstractObjectFactoryImpl implements PedigreeFactory {

	/* (non-Javadoc)
	 * @see com.beerandjesus.sportofkings.handicapper.factory.brisnet.singlefile.PedigreeFactory#getPedigree(java.lang.String)
	 */
	public Pedigree getPedigree(String line) {
		String[] values = getValues(line);
		return getPedigree(values);
	}

	public Pedigree getPedigree(String[] values) {
		PedigreeImpl p = new PedigreeImpl();
		p.setSireName(val(values,52));
		p.setSireSireName(val(values,53));
		p.setDamName(val(values,54));
		p.setDamSireName(val(values,55));
		p.setBreeder(val(values,56));
		p.setStateCountryBred(val(values,57));
		p.setDirtPedigreeRating(val(values,1264));
		p.setMudPedigreeRating(val(values,1265));
		p.setTurfPedigreeRating(val(values,1266));
		p.setDistancePedigreeRating(val(values,1267));
		return p;
	}

}
